//  创建仓库

import Vue from 'vue'
import Vuex from 'vuex'
// 引入vuex 持久化插件
import persist from 'vuex-persistedstate';
Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        count: 0,
        userid: '', // 登录后的用户id
    },
    mutations: { // 
        updateUser(state, payload) {
            state.userid = payload
        }
    },
    plugins: [
        new persist(),
    ]

})

export default store
